package app.domain;

import lombok.*;
import org.springframework.stereotype.Component;

import javax.persistence.*;
import java.io.Serializable;

//标识实体
@Entity
//表名
@Table(name = "rj")
//get set toString
@Getter
@Setter
@ToString
@EqualsAndHashCode
//有参构造
@AllArgsConstructor
//无参构造
@NoArgsConstructor
//标识当前的类会被spring boot扫描并在需要的时候创建对象
@Component
@Embeddable
@IdClass(Rj.class)
public class Rj  implements Serializable {
    // 复合主键要用这个注解
    @Id
    @Column(name = "jurisdictionid")
    private Integer jurisdictionId;
    @Id
    @Column(name = "roleid")
    public Integer roleId;
}
